import request from '@/util/request'
import { dealOpts, SUPPLY } from './../api_type'

// 业务管理
const supplyGetMines = (params, opts) => {
  return request.post(dealOpts(SUPPLY + '/getMines', opts), params)
}

const supplyCreate = (params, opts) => {
  return request.post(dealOpts(SUPPLY + '/create', opts), params)
}

const supplyDelete = (params, opts) => {
  return request.get(dealOpts(SUPPLY + '/delete', opts), params)
}

const supplyGetMine = (params, opts) => {
  return request.get(dealOpts(SUPPLY + '/getMine', opts), params)
}

const supplyUpdate = (params, opts) => {
  return request.post(dealOpts(SUPPLY + '/modify', opts), params)
}

const supplyGetMySkus = (params, opts) => {
  return request.post(dealOpts(SUPPLY + '/getMySkus', opts), params)
}

export default {
  // supply
  supplyGetMines,
  supplyCreate,
  supplyDelete,
  supplyGetMine,
  supplyUpdate,
  supplyGetMySkus
}
